import 'package:flutter/material.dart';

class CommomFloatingActionBottom extends StatelessWidget {
  final String titleText;
  final Function onClick;

  const CommomFloatingActionBottom(
      {super.key, required this.titleText, required this.onClick});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: () {
          // ignore: unnecessary_null_comparison
          if (onClick != null) {
            onClick();
          }
        },
        child: Container(
          height: 40,
          margin: const EdgeInsets.only(left: 20.0, right: 20.0),
          decoration: BoxDecoration(
              color: Colors.green, borderRadius: BorderRadius.circular(12)),
          child: Center(
            child: Text(
              titleText,
              style: const TextStyle(
                  fontSize: 18,
                  color: Colors.white,
                  fontWeight: FontWeight.bold),
            ),
          ),
        ));
  }
}
